package com.godofgamblers.hotelmanagementsystem.service.imp;

import com.godofgamblers.hotelmanagementsystem.mapper.CommentTextMapper;
import com.godofgamblers.hotelmanagementsystem.pojo.Comment;
import com.godofgamblers.hotelmanagementsystem.pojo.User;
import com.godofgamblers.hotelmanagementsystem.service.CommentTextService;
import lombok.Data;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Data
@Transactional
public class CommentTextServiceImp implements CommentTextService {

    @Resource
    private CommentTextMapper commentTextMapper;


    @Override
    public List<Comment> findCommentByRtid(int room_type_id, int index) {
        return commentTextMapper.findCommentByRtid(room_type_id,index);
    }

    @Override
    public int CommentNumberByRtid(int room_type_id) {
        return commentTextMapper.CommentNumberByRtid(room_type_id);
    }

    @Override
    public User findUserNameByUid(int room_type_id) {
        return commentTextMapper.findUserNameByUid(room_type_id);
    }

}
